package com.zhuangwei.spring.controller;

import cn.hutool.core.lang.Dict;
import com.zhuangwei.config.ApplicationConfig;
import com.zhuangwei.config.DeveloperConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LeviCoder
 * @create 2019-03-13 22:55
 */
@RestController
@Slf4j
public class TestController {

    private final  ApplicationConfig applicationConfig;
    private final  DeveloperConfig developerConfig;

    @Autowired
    public TestController(ApplicationConfig applicationConfig,DeveloperConfig developerConfig){
        this.applicationConfig = applicationConfig;
        this.developerConfig = developerConfig;
    }

    @GetMapping("/property")
    public Dict index() {
        return Dict.create().
                set("applicationConfig", applicationConfig).
                set("developerConfig", developerConfig);
    }
}
